import React, { useState } from "react";
import styles from "../css/Ticketlist.module.css";
import Ticket from "./Ticket";
import { InfiniteScroll, List } from 'antd-mobile'
import { useLoaderData } from "react-router-dom";
function Ticketlist() {
  const { list } = useLoaderData();
  // console.log(list);
  const [huoche, sethuoche] = useState(list);
  const [hasMore, setHasMore] = useState(true)
  async function loadMore() {
   console.log('aaaa')
  }
  return (
    <div className={styles.box}>
      <div>
        {huoche.map((item) => {
          return<Ticket key={item.id} {...item}></Ticket>
        })}
         <InfiniteScroll loadMore={loadMore} hasMore={hasMore} />
      </div>
    </div>
  );
}

export default Ticketlist;
